-- GENERATED SPELL FOR [Void Baron Galaxis] --


function spell0_16939(pUnit, Event) --@Absorb Life,Drain--
pUnit:FullCastSpellOnTarget(34239,pUnit:GetRandomPlayer(0))
pUnit:RegisterEvent('Sorts_16939', 5000, 1)
end

function spell1_16939(pUnit, Event) --@Baron\'s Summons,Self--
pUnit:FullCastSpellOnTarget(34236,pUnit)
pUnit:RegisterEvent('Sorts_16939', 626, 1)
end

function spell2_16939(pUnit, Event) --@Coalesce,Self--
pUnit:FullCastSpellOnTarget(34302,pUnit)
pUnit:RegisterEvent('Sorts_16939', 1500, 1)
end

function Sorts_16939(pUnit, Event)
local choix_sorts_16939 = math.random(0, 2)
if choix_sorts_16939 == 0 then
pUnit:RegisterEvent('spell0_16939', 1, 1)
end
if choix_sorts_16939 == 1 then
pUnit:RegisterEvent('spell1_16939', 1, 1)
end
if choix_sorts_16939 == 2 then
pUnit:RegisterEvent('spell2_16939', 1, 1)
end
end

function mob16939_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_16939', math.random(1500, 3000), 1)
end

function mob16939_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16939_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob16939_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(16939, 1, 'mob16939_Action')
RegisterUnitEvent(16939, 2, 'mob16939_Leave')
RegisterUnitEvent(16939, 3, 'mob16939_Kill')
RegisterUnitEvent(16939, 4, 'mob16939_Die')
